package lormi.meipin.controller.api;

import lormi.meipin.annotation.NotValidUser;
import lormi.meipin.common.Result;
import lormi.meipin.controller.BaseController;
import lormi.meipin.exception.LMException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * 闪屏广告
 * */
@RestController
@RequestMapping(value="v2/splashscreen/",method=RequestMethod.POST,produces = "application/json; charset=utf-8")
public class SplashScreenController extends BaseController{

	/**
	 * 按城市获取，闪屏广告页面
	 * @Param cityid 城市ID，如果为0，则表示全国显示
	 * 
	 * */
	@RequestMapping("list")
	@NotValidUser
	@Valid
	public String list(@NotNull(message="100033") @RequestParam(value="cityid",required=false) Integer cityid) throws LMException{
		
		return Result.success(splashScreenService.getOneByCity(cityid));
	}
	
}
